package com.loong.loong.hik.service;


import com.loong.loong.hik.property.request.car.CarAdvanceVehiclelistequestDto;
import com.loong.loong.hik.property.request.car.CarBatchAddRequestDto;
import com.loong.loong.hik.property.request.car.CarDeviceControlRequestDto;
import com.loong.loong.hik.property.request.car.CarDevicecontrolBatchRequestDto;
import com.loong.loong.hik.property.request.car.CarEntranceEntrancelistRequestVo;
import com.loong.loong.hik.property.request.car.CarParkDetailGetRequestVo;
import com.loong.loong.hik.property.request.car.CarParkParklistRequestVo;
import com.loong.loong.hik.property.request.car.CarParkSearchRequestDto;
import com.loong.loong.hik.property.request.car.CarParkTimerangeRequestDto;
import com.loong.loong.hik.property.request.car.CarRoadwayRoadwaylistRequestVo;
import com.loong.loong.hik.property.request.car.CarVehicleTimerangeRequestDto;
import com.loong.loong.hik.property.request.car.CarbatchDeleteRequestDto;
import com.loong.loong.hik.property.result.car.CarAdvanceVehiclelistResultVo;
import com.loong.loong.hik.property.result.car.CarBatchAddResultVo;
import com.loong.loong.hik.property.result.car.CarDeviceControlResultVo;
import com.loong.loong.hik.property.result.car.CarEntranceEntrancelistResultVo;
import com.loong.loong.hik.property.result.car.CarParkDetailGetResultVo;
import com.loong.loong.hik.property.result.car.CarParkParklistResultVo;
import com.loong.loong.hik.property.result.car.CarParkSearchResultVo;
import com.loong.loong.hik.property.result.car.CarParkTimerangeResultVo;
import com.loong.loong.hik.property.result.car.CarRoadwayRoadwaylistResultVo;
import com.loong.loong.hik.property.result.car.CarSingleUpdateResultVo;
import com.loong.loong.hik.property.result.car.CarVehicleTimerangeResultVo;
import com.loong.loong.hik.property.result.car.CarbatchDeleteResultVo;
import com.loong.loong.hik.property.urls.car.HikCarUrl;
import com.loong.loong.hik.util.HikUtil;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * 车道管理
 * @author jinyiang
 * @date 2023/3/12 14:45
 */
@Service
public class HikCarVService {



	@Resource
	private HikUtil hikUtil;
	/**
	 * 批量添加车辆
	 */
	public CarBatchAddResultVo batchAdd(CarBatchAddRequestDto carBatchAddRequestDto) throws Exception{
		return hikUtil.doPost(HikCarUrl.BATCH_ADD, carBatchAddRequestDto, CarBatchAddResultVo.class);
	}
	/**
	 * 修改车辆
	 */
	public CarSingleUpdateResultVo singleUpdate(CarBatchAddRequestDto carSingleUpdate) throws Exception{
		return hikUtil.doPost(HikCarUrl.SINGLE_UPDATE, carSingleUpdate, CarSingleUpdateResultVo.class);
	}
	/**
	 * 批量删除车辆
	 */
	public CarbatchDeleteResultVo batchDelete(CarbatchDeleteRequestDto carbatchDeleteRequestDto) throws Exception{
		return hikUtil.doPost(HikCarUrl.BATCH_DELETE, carbatchDeleteRequestDto, CarbatchDeleteResultVo.class);
	}
	/**
	 * 查询车辆列表v2
	 */
	public CarAdvanceVehiclelistResultVo advanceVehiclelist(CarAdvanceVehiclelistequestDto carAdvanceVehiclelistequestDto) throws Exception{
		return hikUtil.doPost(HikCarUrl.ADVANCE_VEHICLELIST, carAdvanceVehiclelistequestDto, CarAdvanceVehiclelistResultVo.class);
	}
	/**
	 * 增量获取车辆数据
	 */
	public CarVehicleTimerangeResultVo vehicleTimerange(CarVehicleTimerangeRequestDto carVehicleTimerangeRequestDto) throws Exception{
		return hikUtil.doPost(HikCarUrl.VEHICLE_TIMERANGE, carVehicleTimerangeRequestDto, CarVehicleTimerangeResultVo.class);
	}
	//车库管理====================
	/**
	 * 获取停车库列表
	 */
	public CarParkParklistResultVo parkParklist(CarParkParklistRequestVo carParkParklistRequestVo) throws Exception{
		return hikUtil.doPost(HikCarUrl.PARK_PARKLIST, carParkParklistRequestVo, CarParkParklistResultVo.class);
	}
	/**
	 * 查询停车库节点信息
	 */
	public CarParkSearchResultVo parkSearch(CarParkSearchRequestDto carParkSearchRequestDto) throws Exception{
		return hikUtil.doPost(HikCarUrl.PARK_SEARCH, carParkSearchRequestDto, CarParkSearchResultVo.class);
	}
	/**
	 * 获取停车库节点详细信息
	 */
	public CarParkDetailGetResultVo parkDetailGet(CarParkDetailGetRequestVo carParkDetailGetRequestVo) throws Exception{
		return hikUtil.doPost(HikCarUrl.PARK_DETAIL_GET, carParkDetailGetRequestVo, CarParkDetailGetResultVo.class);
	}

	/**
	 * 获取出入口列表
	 */
	public CarEntranceEntrancelistResultVo entranceEntrancelist(CarEntranceEntrancelistRequestVo carEntranceEntrancelistRequestVo)throws Exception{
		return hikUtil.doPost(HikCarUrl.ENTRANCE_ENTRANCELIST, carEntranceEntrancelistRequestVo, CarEntranceEntrancelistResultVo.class);
	}

	/**
	 * 获取车道列表
	 */
	public CarRoadwayRoadwaylistResultVo roadwayRoadwaylist(CarRoadwayRoadwaylistRequestVo carRoadwayRoadwaylistRequestVo)throws Exception{
		return hikUtil.doPost(HikCarUrl.ROADWAY_ROADWAYLIST, carRoadwayRoadwaylistRequestVo, CarRoadwayRoadwaylistResultVo.class);
	}
	/**
	 * 增量获取停车库数据
	 */
	public CarParkTimerangeResultVo parkTimerange(CarParkTimerangeRequestDto carParkTimerangeRequestDto)throws Exception{
		return hikUtil.doPost(HikCarUrl.PARK_TIMERANGE, carParkTimerangeRequestDto, CarParkTimerangeResultVo.class);
	}

	//
	/**
	 * 根据车道编码反控道闸
	 */
	public CarDeviceControlResultVo deviceControl(CarDeviceControlRequestDto carDeviceControlRequestDto)throws Exception{
		return hikUtil.doPost(HikCarUrl.DEVICECONTROL, carDeviceControlRequestDto, CarDeviceControlResultVo.class);
	}
	/**
	 * 根据停车场编码反控道闸
	 */
	public CarDeviceControlResultVo devicecontrolBatch(CarDevicecontrolBatchRequestDto carDevicecontrolBatchRequestDto)throws Exception{
		return hikUtil.doPost(HikCarUrl.DEVICECONTROL_BATCH, carDevicecontrolBatchRequestDto, CarDeviceControlResultVo.class);
	}

}
